<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script>
			window.onload = function()
			{
				let a = document.querySelector('a');
				a.onclick = function(event)
				{
					// 阻止默认事件的方式
					return false;
				}
			}
		</script>
	</head>
	<body>
		<a href="https://www.w3cschool.cn/">123</a>
	</body>
</html>